﻿<!-- 继承公共视图文件 -->
<!-- 方法一：-->
<!-- <extend name="./Application/Admin/View/layout.html" /> -->
<!-- 方法二：-->
<extend name="Public:layout" />
<block name="mid">
	<div class="row">
		<div class="col-lg-12">
			<div class="panel bk-bg-white">
				<div class="panel-heading bk-bg-primary">
					<h6><i class="fa fa-plus-square-o red"></i>商品相册上传</h6>
					<div class="panel-actions">
						<a href="form-dropzone.html#" class="btn-setting"><i class="fa fa-rotate-right"></i></a>
						<a href="form-dropzone.html#" class="btn-minimize"><i class="fa fa-chevron-up"></i></a>
						<a href="form-dropzone.html#" class="btn-close"><i class="fa fa-times"></i></a>
					</div>
				</div>
				<div class="panel-body">

					<div class="form-group">

						<div class="controls">
							<div id="dropzone">
								<form action="{U:('admin/goods/goods_img')}" class="dropzone dz-clickable">
								<!-- 用隐藏标签的形式获取goods_id -->
								<input type="hidden" name="id" value="{$id}">
								<div class="dz-default dz-message"><span>Drop files here to upload</span></div></form>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

	<div class="panel-body">
				<div class="table-responsive">
					<table class="table table-striped table-bordered bootstrap-datatable datatable">
						<thead>
							<tr>
								<th></th>
								<th width="50">ID</th>
								<th>图片</th>
								<th>商品编号</th>
								<th>创建时间</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody>
						<!-- 每循环一次就从list取数据，v就是一维数组 通过v来访问字段名称 -->
						<foreach name="img_list" key="k" item="v" >
							<tr>
								<td><input type="checkbox" name="" value=""></td>
								<td>{$v.id}</td>
								<td><img width="80" height="50" src="__ROOT__/{$v.url}"></td>
								<td>{$v.goods_id}</td>
								<td>{$v.create_time}</td>
								<td>
									<a class="btn btn-danger" href="{:U('admin/goods/del_img/id/'.$v['id'])}">
										<i class="fa fa-trash-o "></i>
									</a>
								</td>
							</tr>
							</foreach>
						</tbody>
					</table>
					<!-- 页码 -->
					<div class="bk-margin-5 btn-group">
						{$page}
					</div>
				</div>
			</div>



</block>

<!-- js部区块 -->
<block name="js">

	<script src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script>
	<script type="text/javascript" src="__ADMIN__assets/js/jquery.validate.min.js"></script>

	<script type="text/javascript">

	</script>

</block>